import re
s='hello python'
pattern='hello'
o=re.match(pattern,s)
print(o)
print(dir(o))
print(o.group())  # 返回匹配的字符串
print(o.span())   # 返回匹配的字符串的开始结束下标
print(o.start())  # 返回开始的下标
print('flags参数的使用')
s='hello python'
pattern='Hello'
o=re.match(pattern,s,flags=re.I)  # flags=re.I 匹配的字符串(Hello)不区分大小写
print(o)
print(o.group())